package com.sunfeng.chap5.connect;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;

public class ConnectTest3_1 {
    public static void main(String[] args)  {
        SocketChannel socketChannel = null;
        try {
            socketChannel = SocketChannel.open();
            System.out.println(socketChannel.isConnectionPending());
            socketChannel.connect(new InetSocketAddress("192.168.139.187", 8888));
            socketChannel.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println(socketChannel.isConnectionPending());
        }

    }
}
